import { GetAvailableRoomsConfig } from "../../GOBE/GOBE";
import { SceneType } from "../CommonValue";
import GameUtils from "../GameUtils";
import { Global } from "../Global";

const { ccclass, property } = cc._decorator;

@ccclass
export default class Match extends cc.Component {
    private lockSubmit: boolean = false;

    OnCreateRoomBtnClick() {
        cc.director.loadScene(SceneType.ROOMINFO);
    }
    OnJoinRoomBtnClick() {
        cc.director.loadScene(SceneType.ROOMLIST);
    }

    async onMatchRoomBtnRoom() {
        this.lockSubmit = true;
        Global.Inst().MatchRoom().then((room) => {
            this.lockSubmit = false;
        }).catch((e) => {
            this.lockSubmit = false;
        });

    }
}
